package tree;



import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Stack;

public class Mirror {
    public static void main(String[] args) {
//        Integer integer = Integer.valueOf(null);
//        TreeNodec six = new TreeNodec(2, null, null);
//        TreeNodec four = new TreeNodec(1, null, null);
//        TreeNodec five = new TreeNodec(2, null, null);
//        TreeNodec two = new TreeNodec(2, null, null);
//        TreeNodec three = new TreeNodec(null, null, null);
//        TreeNodec one = new TreeNodec(1, two, three);
//        System.out.println("先序");
//        System.out.println(isSymmetric(one));
        for (int i = 0; i < 1000; i++) {
            int r = i % 2;
            if(r == 0){
                System.out.println("偶数");
            }
        }
    }
    public static boolean isSymmetric(TreeNodec root) {
        Stack<TreeNodec> leftStack = new Stack<>();
        Stack<TreeNodec> rightStack = new Stack<>();
        TreeNodec leftCur = root.left;
        TreeNodec rightCur = root.right;
        while (leftCur != null || !leftStack.isEmpty()){
            if(leftCur != null){
                leftStack.push(leftCur);
                leftCur = leftCur.left;
                if(rightCur == null) return false;
                rightStack.push(rightCur);
                rightCur = rightCur.right;
            }else{
                TreeNodec popLeft = leftStack.pop();
                TreeNodec popRight = rightStack.pop();
                if(popLeft.val != popRight.val) return false;
                leftCur = popLeft.right;
                rightCur =  popRight.left;
            }
        }
        return true;
    }
}
